package com.example.ixform.services;

import com.example.ixform.dao.NetizenRepository;
import com.example.ixform.entities.Netizen;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class NetizenService {
    
    @Autowired

    NetizenRepository netizenRepository;

    public List<Netizen> getAll(){
        return netizenRepository.findAll();
    }
    public Netizen save(Netizen netizen){
        return netizenRepository.save(netizen);
    }

    public Netizen findByNetizenId(long theId) {

        return netizenRepository.findByNetizenId(theId);
    }
}
